# include <cstdlib>
# include <iostream>
# include <ctime>
# include "mpi.h"
# include "omp.h"
# include <math.h>
using namespace std;

int main ( int argc, char *argv[] );

//****************************************************************************80

int main ( int argc, char *argv[] )

{
    int myid;
    int nprocs;
    int this_thread;
    MPI::Init();
    myid=MPI::COMM_WORLD.Get_rank();
    nprocs=MPI::COMM_WORLD.Get_size();
#pragma omp parallel num_threads(8) private(this_thread)
    {
        double c = 5;
        for(size_t i=0; i<500000000; i++){
            c = pow(c, c);
        }
        this_thread=omp_get_thread_num();
        printf("%d %d\n", this_thread, myid);
        // cout <<this_thread<<" thread from "<<myid<<" is ok\n";
    }
    MPI::Finalize();
    return 0;
}